<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output method="text"/>

    <xsl:variable name="className" select="/object/@clazzName"/>
    <xsl:variable name="package" select="/object/@package"/>
    <xsl:variable name="fields" select="/object/field"/>

    <xsl:template match="//object">
        package <xsl:value-of select="$package"/>;

        public class
        <xsl:value-of select="$className"/>
        <xsl:text> implements java.io.Serializable,ProxyMarker {</xsl:text>

        <xsl:apply-templates select="field" mode="generateField"/>
        <xsl:apply-templates select="field" mode="generateGetter"/>
        <xsl:apply-templates select="field" mode="generateSetter"/>

        <xsl:text> }</xsl:text>

    </xsl:template>

    <xsl:template match="field" mode="generateField">
        private
        <xsl:text> </xsl:text><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>;
    </xsl:template>

    <xsl:template match="field" mode="generateGetter">
        public
        <xsl:value-of select="@type"/>
        <xsl:text> </xsl:text>
        <xsl:value-of select="@getter"/>( ) {
        return this.<xsl:value-of select="@name"/>;
        }
    </xsl:template>

    <xsl:template match="field" mode="generateSetter">
        <xsl:text>public  void </xsl:text>
        <xsl:value-of select="@setter"/>(<xsl:value-of select="@type"/>
        <xsl:text> </xsl:text> <xsl:value-of
            select="@name"/>) {
        this.<xsl:value-of select="@name"/> = <xsl:value-of select="@name"/>;
        }
    </xsl:template>


</xsl:stylesheet>